//
//  GameDetailHeaderView.m
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2022/9/22.
//

#import "GameDetailHeaderView.h"

@interface GameDetailHeaderView ()

@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation GameDetailHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        UIView *topView = [[UIView alloc] init];
        topView.backgroundColor = [UIColor whiteColor];
        [self addSubview:topView];
        [topView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
        }];
        
        UIImageView *leftImage = [[UIImageView alloc] init];
        [leftImage setImage:[UIImage imageNamed:@"ic_game_detail_title_icon"]];
        [topView addSubview:leftImage];
        [leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(topView).offset(14);
            make.centerY.equalTo(topView);
            make.width.height.mas_equalTo(22);
        }];
        
        UILabel *titleLabel = [[UILabel alloc] init];
        titleLabel.font = [UIFont boldSystemFontOfSize:18];
        titleLabel.textColor = [UIColor blackColor];
        [topView addSubview:titleLabel];
        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(leftImage.mas_right).offset(10);
            make.centerY.equalTo(leftImage);
        }];
        
        self.titleLabel = titleLabel;
        
        [self initData];
    }
    return self;
}

- (void)setTitle:(NSString *)title
{
    self.titleLabel.text = title;
}

- (void)initData{};

+(CGFloat)height
{
    return 40;
}


@end
